<?php

require_once '../config.php';
require_once '../db/put/post.php';
require_once '../util/redirect.php';


handlePost();

function handlePost() {

  $pid = (string)$_POST['pid'];
  $title = (string)$_POST['title'];
  $datum = (string)$_POST['datum'];

  $smurfkey = '';

  if( setPost( $pid, $title, $datum, $smurfKey ) == MSG_UNAUTHORIZED )
    echo 'BREAKAGE';

  if( !$_POST['return'] || !sendto($_POST['return']) ) 
    sendto('../view/fora.php');
}

?>
